<template>
  <div>

<div class="nos" >
          <div
            class="no_item"
           v-for="(item,index) in sheepList"
           :key="index"
          >
            <div class="n1">
              <div class="sex" :class="{ on: item.sex === '公' }">{{ item.sex }}</div>
              <p>畜禽标识编号：{{ item.preventionNo }}</p>
            </div>

            <div class="n2">
              <p>耳标号：{{ item.earLabelNo }}</p>
            </div>
            <div class="n2">
              <p>项圈号：{{ item.necklaceNo }} | 月龄：{{ item.monthNum }}</p>
            </div>

          </div>
        </div>
  </div>







    <!-- <div class="seebox">
      <div class="item" v-for="(item,index) in sheepList" :key="index">
        <div class="id">{{item.earLabelNo}}</div>
         <div >畜禽标识编号：{{item.preventionNo}}</div>

        <div class="hao">项圈号：{{item.necklaceNo}} &nbsp; | &nbsp; 月龄：{{item.monthNum}}</div>
        <div class="sex">{{item.sex}}</div>
      </div>
    </div> -->
  </div>
</template>
<script>
import { listPage, query4CircleSelect } from '@/api/record.js'
import { getValue } from '@/utils/auth'

export default {
  components: {},
  data() {
    return {
      sheepList: [] // 羊列表
    }
  },

  created() {
    if (getValue('fzmBreedingArea')) {
      this.loadSheepList()
    }
    if (getValue('fzmBreedStageInfoId')) {
      this.loadSheepList2()
    }
  },
  methods: {
    // 区域
    loadSheepList() {
      listPage({
        page: 1,
        perPage: 999,
        breedingArea: getValue('fzmBreedingArea'),
        houseInfoId: getValue('fzmHourseId')
      }).then(res => {
        if (res.status === 0) {
          this.sheepList = res.data.rows
        }
      })
    },
    // 阶段
    loadSheepList2() {
      query4CircleSelect({
        page: 1,
        perPage: 999,
        breedStageId: getValue('fzmBreedStageInfoId'),
        houseInfoId: getValue('fzmHourseId')
      }).then(res => {
        if (res.status === 0) {
          this.sheepList = res.data.individualInfoList
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.nos {
  padding: 0 15px;
  padding-top: 10px;
  box-sizing: border-box;
  .no_item.on {
    background-color: #f5fbfb;
    border-color: #37b5b5;
  }
  .no_item {
    width: 100%;
    padding: 8px 10px 10px 10px;
    border: 1px solid #cccccc;
    margin-bottom: 10px;
    border-radius: 6px;
    position: relative;
    z-index: 1;
    .sex {
      width: 20px;
      height: 20px;
      margin-right: 6px;
      position: absolute;
      left: 0;
      top: 0;
      z-index: 2;
      background-color: #fdf1f1;
      color: #f29d9d;
      border-radius: 0px 0px 10px 0px;
    }
    .sex.on {
      background-color: #e1f4f4;
      color: #37b5b5;
    }
    .n1 {
      display: flex;
      // align-items: center;
      color: #999;
      font-size: 12px;
      margin-left: 15px;
      margin-bottom: 6px;
      p {
        width: 100%;
        // text-align: center;
      }
    }
    .n2 {
      width: 100%;
      height: 16px;
      display: flex;
      color: #999999;
      font-size: 12px;
      align-items: center;
            margin-left: 15px;

      justify-content: space-between;
      div {
        width: 1px;
        background-color: #999999;
        height: 100%;
      }
    }
  }
}

.seebox {
  padding: 15px;
  .item {
    height: 56px;
    background: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 10px;
    .sex {
      width: 20px;
      height: 20px;
      margin-right: 6px;
      position: absolute;
      left: 0;
      top: 0;
      border-radius: 6px 0 10px 0;
      z-index: 2;
      background-color: rgba(242, 157, 157, 0.15);
      color: #f29d9d;
      text-align: center;
      line-height: 20px;
    }
    .id {
      font-size: 14px;
      color: #333333;
      margin-right: 15px;
    }
    .hao {
      color: #999999;
      font-size: 12px;
    }
  }
}
</style>
